<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : MainPage.xsl
    Created on : May 24, 2013, 8:45 PM
    Author     : Kim
    Description:
        Purpose of transformation follows.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"/>

    <!-- TODO customize transformation rules 
         syntax recommendation http://www.w3.org/TR/xslt 
    -->
    <xsl:template match="products">
       <xsl:for-each select="product">
           <xsl:if test="(noSell='0')">
                <div class="product_box">
                    <a>
                        <img>
                            <xsl:attribute name="src" >
                                <xsl:value-of select="Image"/>
                            </xsl:attribute>
                        </img>
                    </a>
                    <h3>
                        <xsl:value-of select="proName"/>
                    </h3>
                    <p class="product_price">VND
                        <xsl:value-of select="format-number(Price, '###,###')"/>
                    </p>
                    <a style="cursor: hand; cursor: pointer;"  class="add_to_card"><xsl:attribute name="onclick" >addToCart('<xsl:value-of select="proID"/>','<xsl:value-of select="proName"/>','<xsl:value-of select="Price"/>')</xsl:attribute> Add to Cart</a>
                    
                    <a href="#" onclick="viewProductDetail('{proID}')" class="detail">Detail</a>
                </div>
                </xsl:if>
            </xsl:for-each>
        
    </xsl:template>

</xsl:stylesheet>
